Copyright: Copyright ® 1992-1996 Crescent Software, Inc.
Citation: Copyright ® 1992-1996 Crescent Software, Inc.


Modem Script Commands A to Z
 ModemWare Communication Script Commands

Use the commands listed in this topic to build script files that automate your communcations activities. Script files are text files containing script commands that perform a communications task. You can create scripts that call a host system, read mail, transfer files, and much more.

Symbols

:LABEL Command

C

CAPTURE Command
CLOSECAPTURE Command

D

DIAL Command
DOWNLOAD Command

E

END Command

H

HANGUP Command

I

INPUT Command

O

ON_TIMEOUT GOTO Command

P

PAUSE Command
PORT Command
PROTOCOL Command

S

SEND Command
SETTINGS Command
STOP Command

T

TIMEOUT Command

U

UPLOAD Command

W

WAITFOR Command


 :LABEL Command

Specifies a label. This works the same as with batch files. Any word that starts with a colon is treated as a label.

Syntax

:label

Example

:JumpHere


 CAPTURE Command

Opens a specified capture file and logs all received data to a specified file.

Syntax

CAPTURE filename$

Example

CAPTURE "C:\CSERVE.TXT"

See Also

CLOSECAPTURE


 CLOSECAPTURE Command

Closes the capture file opened previously with CAPTURE.

Syntax

CLOSECAPTURE

See Also

CAPTURE


 DIAL Command

Dials a phone number and connects to a host modem.

Example

DIAL "555-1212", 10
WAITFOR "Press Enter to Continue" SEND "^M"

This example dials 555-1212. The second argument (10) specifies the number of retries if the line happens to be busy. After a connection is made, it waits to receive Press Enter to Continue and then sends a carriage return.

See Also

:LABEL, ON_TIMEOUT_GOTO, WAITFOR, SEND.


 DOWNLOAD Command

Downloads (receives) a file.

Syntax

DOWNLOAD [filename$]

Examples

'-- Receives the file C:\MYPROG\ZIPFILE.ZIP via Xmodem-CRC.
PROTOCOL "XMODEM-CRC"
DOWNLOAD "C:\MYPROG\ZIPFILE.ZIP"

'-- Receives a file via ZMODEM.
PROTOCOL "ZMODEM"
DOWNLOAD

NOTE  	With the ZMODEM protocol, the file name is not specified. This is because the remote side of a zmodem transfer session does not require a filename. This is also true for YMODEM- BATCH, and YMODEM-G.

See Also

PROTOCOL


 END Command

Ends the script. END does not close the communications port.

Syntax

END


 HANGUP Command

Hangs up the phone. Hangup does not close the communications port, it only disconnects the modem.

Syntax

HANGUP


 INPUT Command

Prompts the user for a string and stores the data as a string in a variable.

Syntax

INPUT msgStr$, variableName

Example

INPUT "Enter Your Password", PassWord
SEND PassWord
SEND "^M"

This example displays an input dialog box with the message; Enter Your Password and stores the entered text in a variable named PassWord. Then, that text is sent out the communications port followed by a carriage return.

See Also

SEND


 ON_TIMEOUT_GOTO Command

Tells the script to jump to a label when a timeout occurs. Several things can cause a timeout to occur; a busy signal on the other end of the line, accessing an inactive modem, etc.

Syntax

ON_TIMEOUT_GOTO :label

Example

ON_TIMEOUT_GOTO :JumpHere

See Also

:LABEL


 PAUSE Command

Pauses for a specified number of seconds.

Syntax

PAUSE n%

Example

PAUSE 1 	'-- Wait one second.

NOTE  	Sometimes a pause is required in between a WAITFOR and a SEND command, or in other places to smooth out the communications process. This may require experimentation.

See Also

WAITFOR, SEND


 PORT Command

Specifies which port to use and opens the port. By default, scripts use the current port with its current settings.

Syntax

PORT n%

Example

PORT 2	'-- Use COM2.


 PROTOCOL Command

Sets the file transfer protocol.

Syntax

PROTOCOL protocol$

protocol$ is one of the following string identifiers:

XMODEM-CHECKSUM	YMODEM-G
XMODEM-CRC	ZMODEM
XMODEM-1K	KERMIT
YMODEM-BATCH	COMPUSERVE
NOTE  	You must issue this command to set the protocol before either a DOWNLOAD or UPLOAD command. If you do not, the script uses the current protocol setting for the PDQComm control.

Example

PROTOCOL "ZMODEM"

See Also

DOWNLOAD, UPLOAD


 SEND Command

Sends a string out of the communications port. The Send command treats an unquoted string as a variable, sending the text in the variable.

You can embed control codes in the text. These are defined in ASCII as ^A through ^Z corresponding to ASCII values 1 through 31 respectively. Thus, ^G is a beep, ^M is a carriage return, ^J is a linefeed, etc.

Examples

SEND "Hello Over There^M"	'-- Sends the string followed by a
'   carriage return.

'-- This example asks the user for his/her name, and sends
' it followed by a CR/LF.
INPUT "Enter Your Name", UserName
SEND UserName
SEND "^M^J"

See Also

INPUT


 SETTINGS Command

Specifies the baud rate, parity, data bits, and stop bits. By default, scripts use the current port with its current settings if the communications port is opened.

Syntax

SETTINGS string$

The setting string is composed of four settings and has the following format:

"BBBB,P,D,S"

Where BBBB is the baud rate, P is the parity, D is the number of data bits, and S is the number of stop bits.

Example

SETTINGS "9600,N,8,1"


 STOP Command

Stops program execution. Use this command to debug your scripts. When a script encounters the STOP command, Visual Basic stops program execution. If you are running your program as an executable, the program exits.

Syntax

STOP


 TIMEOUT Command

Specifies the number of seconds that WAITFOR waits before timing out.

Syntax

TIMEOUT n%

Example

TIMEOUT 30

See Also

WAITFOR


 UPLOAD Command

Uploads (transmits) a file.

Syntax

UPLOAD [filename$]

Examples

'-- Sends the file C:\MYPROG\ZIPFILE.ZIP via Zmodem.
PROTOCOL "ZMODEM"
UPLOAD "C:\MYPROG\ZIPFILE.ZIP"

'-- Sends a file via Compuserve B+.
PROTOCOL "COMPUSERVE"
UPLOAD

NOTE  	With the Compuserve protocol, the file is not specified. This is because the remote side of a Compuserve transfer session does not require a filename.

See Also

PROTOCOL


 WAITFOR Command

Waits to receive a string over the communications port.

Syntax

WAITFOR string$

Example

TIMEOUT 30
DIAL "555-1212"
WAITFOR "What Is Your Name?"
SEND "ModemWare^M"

This example dials 555-1212 and waits up to 30 seconds (specified by TIMEOUT) after connecting to receive What Is Your Name? from the host system, and sends ModemWare followed by a carriage return.

See Also

:LABEL, ON_TIMEOUT_GOTO, TIMEOUT